<template>
  <div class="mainPart">
    <div class="merchant-list" ref="wrapper">
      <div v-if="merchantList.length">
        <router-link to="/merchantListetailList">
          <van-card
            v-for="(item, index) in merchantList"
            :key="index"
            :tag="item.tag"
            :desc="item.desc"
            :title="item.title"
            :thumb="item.imageURL"
          >
            <div slot="footer">
              <van-button size="mini">按钮</van-button>
              <van-button size="mini">按钮</van-button>
            </div>
          </van-card>
        </router-link>
      </div>
      <p class="nullData" v-if="!merchantList.length">暂无数据</p>
    </div>
  </div>
</template>

<script>
import BScroll from "better-scroll";
export default {
  data() {
    return {
      merchantList: []
    };
  },
  mounted() {
    const options = {
      click: true,
      tap: true
    };
    this.$nextTick(() => {
      if (!this.scroll) {
        this.scroll = new BScroll(this.$refs.wrapper, options);
      } else {
        this.scroll.refresh();
      }
    });
  },
  methods: {}
};
</script>

<style lang="stylus" scoped>
.merchant-list {
  position: absolute;
  top: 3.5rem;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;

  .nullData {
    text-align: center;
    font-size: 0.48rem;
    line-height: 1rem;
  }
}
</style>
